package main

import (
	"fmt"
)

func main() {
	a := 10
	//条件表达式的结果必须是布尔值
	if a > 10 { // {一定不能单独成一行
		fmt.Println("a bigger than 10")
	} else if a < 10 {
		fmt.Println("a less than 10")
	} else {
		fmt.Println("a equal 10")
	}

	//switch分支
	fmt.Println("which fruit do you like?")
	var fruit string
	fmt.Scanf("%s", &fruit)

	switch fruit {
	case "apple":
		fmt.Println("you like apple")
		fallthrough //继续执行下一个分支
	case "banana":
		fmt.Println("you like banana")
		fallthrough
	case "orange":
		fmt.Println("you like orange")
		fallthrough
	default:
		fmt.Println("you like nothing")
	}
}
